/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package javacroft.business;

/**
 *
 * @author hind
 */
public class Notation
{

    private float uneNote;  
    private ECUE uneMatiere;
    private boolean isSecondSession;

    /* constructeurs*/   

    public Notation(ECUE uneMatiere,float uneNote,boolean rattrap)
    {        
        this.uneMatiere=uneMatiere;
        this.uneNote=uneNote;
        this.isSecondSession = rattrap;
    }

    /* getteurs*/
    public float getNote()
    {
        return this.uneNote;
    }   

    public ECUE getMatiere()
    {
        return this.uneMatiere;
    }
	///
    public void setNote(float n)
    {
	this.uneNote=n;
    }    

    public void setMatiere(ECUE e)
    {
	this.uneMatiere=e;
    }


 public String toString()
    {
         String machaine = "";

        machaine = this.getMatiere().getNom()+ " : "+Float.toString(uneNote)+"/20 | rattrapage : "+isSecondSession;

        return machaine;
    }

    public int compareTo(Notation uneNote)
  {
        if (this.uneNote==uneNote.getNote())
     {
        return 0;
     }
     else if (this.uneNote>uneNote.getNote())
     {
        return 1;
     }
     else return -1;
  }

    public boolean compareTo(String nomEcue)
    {
        return uneMatiere.compareTo(nomEcue);
    }

    public boolean compareTo(ECUE ecue)
    {
        return uneMatiere.compareTo(ecue) == 0;
    }

    /**
     * @return the isSecondSession
     */
    public boolean isIsSecondSession()
    {
        return isSecondSession;
    }

    /**
     * @param isSecondSession the isSecondSession to set
     */
    public void setIsSecondSession(boolean isSecondSession)
    {
        this.isSecondSession = isSecondSession;
    }

}